package app;

import javax.swing.JFrame;

import events.Action;

/**
 * Classe contenente il void main() Contiene l'istanza del menu principale.
 * 
 * @author TeamVulcan
 * 
 */
public class GameFrame extends JFrame {

	private static GameFrame frame = new GameFrame();
	public static Action acts;
	private static MainMenu main;

	public static void main(String[] args) {
		main = new MainMenu();
		frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
		frame.setTitle("DartBall Game");
		frame.setSize(300, 300);
		frame.setLocationRelativeTo(null);
		frame.setVisible(true);
		frame.add(main);
	}

	public static GameFrame getFrame() {
		return frame;
	}

	public static void setFrame(GameFrame frame) {
		GameFrame.frame = frame;
	}

	public static void refreshMainMenu() {
		main.removeAll();
		main.createMain();
		main.repaint();
		main.validate();
		frame.setSize(300, 300);
		frame.setLocationRelativeTo(null);
	}
}
